import 'package:dio/dio.dart';

import 'response_data.dart';

class ApiErrorProcessor {

  // TODO 根据错误类型，进行统一的异常处理
  static ResponseData processError(DioException e) {
    String errorMsg = "出现异常$e";
    print('error=====${e.requestOptions.path}=====$e');
    // showToast(errorMsg);
    return ResponseData(true, -101, errorMsg, [], path: e.requestOptions.path);
  }
}
